﻿@model Exception

@{
    ViewBag.Title = "ERROR";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var logs = HttpContext.Current.Items["BlobServiceLog"] as System.Text.StringBuilder;
    if (logs == null)
    {
        logs = new System.Text.StringBuilder();
    }
    bool disableLogin = CloudStorageLight.Core.SystemSettings.Instance.DisableLogin;
}
@section header{

<div class="container body-content" id="maindiv">
    <header class="nrm nlm">
        <div class="clearfix bg-darkBlue fg-white" id="header-cont">
            <div class="place-right">

                @if (Request.IsAuthenticated)
                {
                    <div class="margin10">
                        <i class="icon-user"></i>
                        @(User.Identity.Name == null ? "GUEST" : User.Identity.Name.Split('@')[0])
                        <a id="logoff" href="@Url.Action("LogOff", "Account", new { domain = CloudStorageLight.Core.BlobService.GetCurrentDomain() })"><i class="icon-exit" title="logoff" style="background:white;color:blue;padding:10px;border-radius:50%"></i></a>
                    </div>
                }

            </div>

            <div class="place-left margin10">
                <nav class="horizontal-menu">
                    <ul>
                        @Html.Partial("_HomeCommand")


                    </ul>
                </nav>

            </div>

            <div class="place-right">
            </div>
        </div>
    </header>
    </div>
}

<div style="margin:20px;">
    <h2 class="text-danger">@(CloudStorageLight.Core.Web.ViewMessages.MsgErrorMessage)</h2>
    @if (Model != null)
    {
        if (Model.GetType().Namespace == "System")
        {
            <h2 class="error-message">@(CloudStorageLight.Core.Web.ViewMessages.MsgGeneral)</h2>
        }
        else if (Model is System.Web.Mvc.HttpAntiForgeryException)
        {
            <h2 class="error-message">@(CloudStorageLight.Core.Web.ViewMessages.MsgRetryForSecurity)</h2>
        }
        else
        {
            <h2 class="error-message">@(Model == null ? "" : Model.Message)</h2>
        }

    }
    <h4>@(ViewData["Id"] ?? "")</h4>
    <hr />
    <div>
        <h3 id="detail-btn"><a href="#">@(CloudStorageLight.Core.Web.ViewMessages.MsgDetail)</a></h3>
        <div id="detail" style="display:none;">
            <div>
                @(Model.ToString()))
            </div>
            <hr/>
            <div>
                @(logs.ToString()))
            </div>

        </div>
    </div>

</div>

@section scripts {
    <script type="text/javascript">

        $(function () {

            $('#detail-btn').click(function () {
                $('#detail').slideToggle('slow');
            });

        });

    </script>
}
